﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AdminHome.Models;
namespace TestAdmin
{
    [TestClass]
    public class UnitTest1
    {
        //[TestMethod]
        //public void TestMethod1()
        //{
        //    var i = 1;
        //    var i2 = 4;

        //    System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\\Users\\User 1\\Documents\\Visual Studio 2010\\Projects\\ITAssetControlJDG\\MVCSiteJDG\\App_Data\\MyDatabase#1.sdf");

        //    System.Data.OleDb.OleDbCommand getAccountDetailsCommand = new System.Data.OleDb.OleDbCommand("select * from product where rowID >" + i + " and rowID < " + i2 + "", connection);

        //    connection.Open();
        //    System.Data.OleDb.OleDbDataReader reader = getAccountDetailsCommand.ExecuteReader();
        //    String[] SqlData = new String[8];
        //    var writeThisAsHtml = "<table>";
        //    writeThisAsHtml += "<tr><td>Image</td><td>Product</td><td>catID</td><td>name</td><td>description</td><td>indate</td><td>order</td>";
        //    while (reader.Read())
        //    {

        //        SqlData[0] = reader.GetString(0);
        //        SqlData[1] = reader.GetString(1);
        //        SqlData[2] = reader.GetString(2);
        //        SqlData[3] = reader.GetString(3);
        //        SqlData[4] = reader.GetString(4);
        //        SqlData[5] = reader.GetString(5);
        //        SqlData[6] = reader.GetString(6);
        //        SqlData[7] = (String) reader.GetValue(7).ToString();
        //        writeThisAsHtml += "<tr>" + "<td>" + SqlData[5] + "</td> <td>" + SqlData[0] + "</td> <td>" + SqlData[1] + "</td> <td>" + SqlData[2] + "</td> <td>" + SqlData[3] + "</td> <td>" + SqlData[6] + "</td><td><input name=" + SqlData[7] + " type=\"checkbox\"></input></td></tr>";
        //    }



        //    writeThisAsHtml += "</table>";
        //}
        //[TestMethod]
        //public void getShoppingCart()
        //{
        //    System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\\Users\\User 1\\Documents\\Visual Studio 2010\\Projects\\ITAssetControlJDG\\MVCSiteJDG\\App_Data\\MyDatabase#1.sdf");

        //    var shoppingCartID = "1";
        //    System.Data.OleDb.OleDbCommand getShoppingCartCommand = new System.Data.OleDb.OleDbCommand("select productID from CartItem where cartID ='" + shoppingCartID + "'", connection);

        //    connection.Open();
        //    System.Data.OleDb.OleDbDataReader reader = getShoppingCartCommand.ExecuteReader();
        //    var shoppingCart = new ShoppingCart();


        //    while (reader.Read())
        //    {
        //        string Temp = reader.GetString(0);
        //        shoppingCart.addProduct(Temp);
        //    }

        //    return;

        //}
    }
}
